<ui:composition
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

	<h:panelGroup rendered="#{not empty timeBean.times}">
		<h2>Lista de Times</h2>

		<h:dataTable id="tabela" value="#{timeBean.times}" var="time"
			styleClass="dados" rowClasses="par,impar">

			<h:column>
				<f:facet name="header">
					<h:outputText value="id" />
				</f:facet>
	#{time.id}
	</h:column>

			<h:column>
				<f:facet name="header">
					<h:outputText value="Nome" />
				</f:facet>
	#{time.nome}
	</h:column>

			<h:column>
				<f:facet name="header">
					<h:outputText value="Tecnico" />
				</f:facet>
	#{time.tecnico}
	</h:column>


			<h:column>
				<f:facet name="header">
					<h:outputText value="Alterar" />
				</f:facet>

				<f:ajax event="click" render="@form"
					listener="#{time.preparaAlteracao}">
					<h:commandLink>
						<f:param name="id" value="#{time.id}" />
	Alterar
	</h:commandLink>
				</f:ajax>
			</h:column>


			<h:column>
				<f:facet name="header">
					<h:outputText value="Remover" />
				</f:facet>

				<f:ajax event="click" render="@form" listener="#{time.remove}">
					<h:commandLink>
						<f:param name="id" value="#{time.id}" />
	Remover
	</h:commandLink>
				</f:ajax>
			</h:column>

		</h:dataTable>
	</h:panelGroup>
</ui:composition>